export class DefaultBean<T> {
  defaultType: string = ""

  defaultEntity: T

  jsonValue: ESObject | null = null

  constructor(defaultE: T, defaultT: string) {
    this.defaultEntity = defaultE
    this.defaultType = defaultT
  }

  asTargetType(): T {
    if (this.jsonValue != null) {
      return this.jsonValue as T
    } else {
      throw Error("类型异常啦")
    }
  }
}